package student.web.internal;

import org.zkoss.zk.ui.Desktop;
import org.zkoss.zk.ui.util.DesktopCleanup;

import cloudspace.vm.io.console.CometEvent;
import cloudspace.vm.io.console.ConsoleLines;


public class DesktopLoggerCleanup implements DesktopCleanup
{

    public void cleanup( Desktop desktop ) throws Exception
    {
        desktop.enableServerPush( false );
        CometEvent updateThread = (CometEvent)desktop.getAttribute( ConsoleLines.COMET_THREAD );
        if ( updateThread != null )
            updateThread.halt();
    }

}
